# 作者：小七
# 2024年12月26日

def use_sum():
    """
    学习算数运算符
    :return:
    """

    a = 5 / 2
    print(a)
    a = 5 // 2
    print(a)


use_sum()


def use_compare():
    print(3 > 5)


use_compare()


def use_logic():
    print(3 and 5)
    print(3 or 5)


use_logic()


# 3 and print('hello')

def use_logic2():
    a = False

    a and print('hello')

    a = True

    a or print('看到or')


use_logic2()


def use_bit():
    print(5 & 7)
    print(5 | 7)
    print(~5)
    print(5 ^ 7)
    print(5 << 1)
    print(-5 << 1)
    print(5 >> 1)
    print(-5 >> 1)  # -1/2
    print(5 ^ 5)
    print(5 ^ 0)


use_bit()
